<template>
	<view>
		<u-image width="140rpx" height="140rpx" :src="src"></u-image>
	</view>
</template>

<script>
	export default {
		name: "CourseCoreCompetence",
		props: {
			competence: {
				type: String,
				default () {
					return ''
				}
			},
			
			coreCompetence: {
				type: String,
				default () {
					return ''
				}
			}
		},
		data() {
			return {
				src: '',
			}
		},
		mounted() {
			this.formatSrc();
		},
		methods: {
			formatSrc() {
				const competence = this.$props.competence;
				const coreCompetence = this.$props.coreCompetence;
				console.log(competence);
				console.log(coreCompetence);
				console.log(coreCompetence.indexOf(competence));
				if (competence === 'Q') {
					if (coreCompetence.indexOf(competence) !== -1) {
						// this.src = require("@/pages_teach/static/course_q_press.png");
					} else {
						// this.src = require("@/pages_teach/static/course_q_normal.png");
					}
				}
				
				if (competence === 'Z') {
					if (coreCompetence.indexOf(competence) !== -1) {
						// this.src = require("@/pages_teach/static/course_z_press.png");
					} else {
						// this.src = require("@/pages_teach/static/course_z_normal.png");
					}
				}
				
				if (competence === 'L') {
					if (coreCompetence.indexOf(competence) !== -1) {
						// this.src = require("@/pages_teach/static/course_l_press.png");
					} else {
						// this.src = require("@/pages_teach/static/course_l_normal.png");
					}
				}
			}
		}
	}
</script>

<style>
</style>
